<%--
  Created by IntelliJ IDEA.
  User: 常红伟
  Date: 2021/4/20
  Time: 11:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>错误</title>
</head>
<link rel="stylesheet" href="bootstrap.min.css">
<link href="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/3.0.1/css/bootstrap.css" rel="stylesheet">
<script src="jquery-3.3.1.min.js" type="text/javascript"></script>
<script src="bootstrap.min.js" type="text/javascript"></script>
<body>
<div class="container">
    <div class="row clearfix">
        <div class="col-md-12 column">
            <div class="alert alert-dismissable alert-warning">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                <h4>错误！
                </h4> <strong>Warning!</strong>   <%=request.getAttribute("errmsg")%> <a href="#" class="alert-link"></a>
                <span id="seconds">5</span>秒后自动为您跳转回班级首页
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    var interval;

    $(function(){
        interval = window.setInterval("changeSecond()", 1000);// 设置定时器，每隔1秒，执行一次changeSecond()方法
    });

    function changeSecond() {
        var second = $("#seconds").text();
        second = second - 1;

        if(second == 0) {

            // 清除定时器
            window.clearInterval(interval);
            window.location.href = "findClassesAll";
            return;
        }

        $("#seconds").text(second);
    }
</script>

</html>
